<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>vue中data数据定义的第二种方式</title>
	<script src="./lib/vue2.2.2.min.js" ></script>
</head>

<body>
	<div id="app">
	<h1> {{name}} </h1>
	<h1> {{age}} </h1>
	<h1> {{tel}} </h1>
	<h1> {{cs()}} </h1>

	</div>
	<script>
	var people = {name:"李白",age:18,tel:"18616932399"}
	var cs = function(){
		return "我是定义的函数";
	}
	var v = new Vue({
	  //绑定 
	  el: '#app', //id绑定注意#不能遗漏,id必须唯一
	  data:people, //people对象赋值给data
	  methods:cs
	})
	v.name = "我是新李白"; //修改方式1
	people.age = "我是新的18岁"; //修改方式2
	</script>
	
</body>
</html>
